﻿@model MVC3DEMO.Models.Post

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


 

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Post</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>

       
        <div class="editor-field">
           @Html.TextAreaFor(model => model.Body, new { @class = "ckeditor" })
            @Html.ValidationMessageFor(model => model.Body)
        </div>

      

        <div class="editor-label">
            @Html.LabelFor(model => model.Priority)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Priority)
            @Html.ValidationMessageFor(model => model.Priority)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Show)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Show)
            @Html.ValidationMessageFor(model => model.Show)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
   
<script src="@Url.Content("~/ckeditor/ckeditor.js")" type="text/javascript"></script>
<script type="text/javascript">

    CKEDITOR.replace('Body');
    
</script>
<!--Config CKFinder-->
<script src="@Url.Content("~/ckfinder/ckfinder.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#btnSelectImg").click(function () {
            var finder = new CKFinder();
            finder.selectActionFunction = function (fileUrl) {
                $('#ImageUrl').val(fileUrl);
            };
            finder.popup();
        });
    });

    function SetFileField(fileUrl) {
        $('#ImageUrlssss').val(fileUrl);
    }
    
</script>



<div>
    @Html.ActionLink("Back to List", "Index")
</div>
